using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Data.DataSources {
	public class GroupsDataSource : ObjectDataSourceBase {
		public override bool UseNoLock { get { return false; } }
		public override string SelectViewName { get { return "fs_Groups()"; } }
		public override string InsertViewName { get { return ""; } }
		public GroupsDataSource() {
			//OrderBy.Add("IsGroup DESC,Name");
		}
		public override DataView SelectEx() {
			Dimok.Data.ADsGroupDS.t_GroupDataTable dtGroups = new Dimok.Aspx.Manager.UOX().GetAllGroupsInNamespace().t_Group;
			dtGroups.cnColumn.ColumnName = "Name";
			dtGroups.Columns.Add("principal_id",typeof(string),"Name");
			dtGroups.DefaultView.RowFilter = Wheres().Replace("WHERE ", "");
			if (dtGroups.DefaultView.Count == 0 && EmtyRowPolicy == Dimok.Data.DataSources.EmptyRowPolicyType.OnlyIfEmpty) {
				dtGroups.DefaultView.RowFilter = "";
				dtGroups.Addt_GroupRow("", "", "", "");
			}
			return dtGroups.DefaultView;
		}
	}
}